cmake_minimum_required(VERSION 3.20)

project(GAME)

set(SDL2_ROOT ${CMAKE_SOURCE_DIR}/SDL2-2.0.22)
set(SDL2_DIR ${SDL2_ROOT}/x86_64-w64-mingw32/lib/cmake/SDL2)
find_package(SDL2 REQUIRED)

set(SDL2_IMAGE_ROOT ${CMAKE_SOURCE_DIR}/SDL2_image-2.0.5)

add_executable(game01 main.c)
target_include_directories(game01 PRIVATE
    ${SDL2_ROOT}/x86_64-w64-mingw32/include
    ${SDL2_IMAGE_ROOT}//x86_64-w64-mingw32/include)
target_link_directories(game01 PRIVATE
    ${SDL2_ROOT}/x86_64-w64-mingw32/lib
    ${SDL2_IMAGE_ROOT}/x86_64-w64-mingw32/lib) 
target_link_libraries(game01 ${SDL2_LIBRARIES} libSDL2_image)

file(GLOB 3rd_dll
    ${SDL2_ROOT}/x86_64-w64-mingw32/bin/*.dll
    ${SDL2_IMAGE_ROOT}/x86_64-w64-mingw32/bin/*.dll)
file(COPY ${3rd_dll} DESTINATION ${CMAKE_CURRENT_BINARY_DIR})